package com.ticket.system.mapper;

import com.ticket.system.domain.YanchuSeat;
import com.ticket.system.domain.vo.SeatCompareVo;
import com.ticket.system.domain.vo.SeatDetailVo;
import com.ticket.system.domain.vo.SeatVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 场次座位Mapper接口
 * 
 * @author ruoyi
 * @date 2023-09-26
 */
public interface YanchuSeatMapper 
{
    /**
     * 查询场次座位
     * 
     * @param id 场次座位主键
     * @return 场次座位
     */
    public YanchuSeat selectYanchuSeatById(Long id);

    /**
     * 查询场次座位列表
     * 
     * @param yanchuSeat 场次座位
     * @return 场次座位集合
     */
    public List<YanchuSeat> selectYanchuSeatList(YanchuSeat yanchuSeat);

    public List<SeatVo> selectSeatVoList(@Param("sessionId")Long sessionId);

    /**
     * 查询预留座
     * @param sessionId
     * @return
     */
    public List<SeatCompareVo> selectResSeatVoList(@Param("sessionId")Long sessionId);

    public List<SeatVo> selectSeatVoExportList(@Param("sessionId")Long sessionId);
    public List<SeatDetailVo> selectSeatVoDetailList(@Param("sessionId")Long sessionId);

    public List<YanchuSeat> selectOpenSeatList(YanchuSeat yanchuSeat);

    public Long selectCountSeatList(@Param("sessionId")Long sessionId);

    /**
     * 新增场次座位
     * 
     * @param yanchuSeat 场次座位
     * @return 结果
     */
    public int insertYanchuSeat(YanchuSeat yanchuSeat);
    public int insertBatchSeat(@Param("list")List<YanchuSeat> list);

    public int grabBatchSeat(@Param("userId")Long userId,@Param("list")List<YanchuSeat> list,
                             @Param("status")Integer status,@Param("oldStatus")Integer oldStatus,
                             @Param("orderId")Long orderId);

    public int batchUpdateSeatOpen(@Param("list")List<YanchuSeat> list,
                             @Param("status")Integer status,@Param("oldStatus")Integer oldStatus);
    public int batchUpdateSeatNotOpen(@Param("reservedId")Long reservedId,
                           @Param("status")Integer status,@Param("id")Long id);
    /**
     * 修改场次座位
     * 
     * @param yanchuSeat 场次座位
     * @return 结果
     */
    public int updateYanchuSeat(YanchuSeat yanchuSeat);

    public int batchOpenSeat(@Param("sessionId")Long sessionId,@Param("list")List<SeatCompareVo> list);

    public int batchLeaveSeat(@Param("sessionId")Long sessionId,@Param("list")List<SeatCompareVo> list);
    public int batchSeatOpen(@Param("sessionId")Long sessionId,@Param("list")List<SeatCompareVo> list);

    public int updateSeatOpen(@Param("sessionId") Long sessionId);

    public int updateSeatCancel(@Param("orderId") Long orderId, @Param("status") Integer status, @Param("oldStatus") Integer oldStatus);

    /**
     * 删除场次座位
     * 
     * @param id 场次座位主键
     * @return 结果
     */
    public int deleteYanchuSeatById(Long id);

    /**
     * 批量删除场次座位
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteYanchuSeatByIds(@Param("array")Long[] ids);

    public int cancelSeatBySessionId(@Param("sessionId")Long sessionId);

    public int deleteSeatBySessionId(@Param("sessionId")Long sessionId);

    public int updateSeat(@Param("tickets") List<String> tickets, @Param("status") Integer status, @Param("oldStatus") Integer oldStatus);

    public int updateBackendSeat(@Param("tickets") List<String> tickets, @Param("oldStatus") Integer oldStatus);

    public int updateSeatByOrderId(@Param("orderId") Long orderId, @Param("status") Integer status,
                                   @Param("oldStatus") Integer oldStatus);

    List<YanchuSeat> selectYanchuSeatListByPriceIds(@Param("priceIds") List<Long> priceIds);

    public List<YanchuSeat> selectYanchuSeatByTicket(@Param("array")List<String> tickets);

    List<YanchuSeat> selectRowListByAreaId(@Param("idArea") Long idArea);

    List<YanchuSeat> selectSeatListByRowNo(@Param("rowNumber")Long rowNumber,@Param("idArea")Long idArea);
}
